package com.commerce.mapping;

import com.commerce.model.Menu;
import com.commerce.model.Role;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.dao.DataAccessException;

import java.util.List;

/**
 * @author wyj
 * @Title:
 * @Description:
 */
@Mapper
public interface RoleMapping extends BeanMapping<Role>{

    /**
     * 判断角色名称是否存在
     * @param name
     * @return
     * @throws DataAccessException
     */
    int selectByName(@Param("name") String name)throws DataAccessException;

    /**
     * 根据角色ID查询菜单列表
     * @param ids
     * @return
     * @throws DataAccessException
     */
    String selectMenuids(String ids)throws DataAccessException;

    /**
     * 根据ID集合查询
     * @param ids
     * @return
     * @throws DataAccessException
     */
    List<Role> selectByRoleIds(String ids)throws DataAccessException;
}
